<template>
	<view class="all-content">
		<scroll-view scroll-y="true" style="height:calc(100vh - 700rpx);">
			<view class="t-content" v-for="(it,i) in dataList" :key="i" @click="jump(it)">
				<view class="top-content">
					<view class="top-ring" v-if="ownerCode !== 'hg'">{{ getContent(it) }}</view>
					<view class="top-ring" v-else>{{ getContentByHg(it) }}</view>
					<!-- :class="setLevelColor(it.rankClass)" -->
					<view class="top-lv" :class="{'red':it.rankClass === 'tall','orange':it.rankClass === 'central', 'blue':it.rankClass === 'bottom' || it.rankClass === 'nought'}">{{it.diseaseGradeName}}{{it.diseaseNo || ''}}</view>
					<view class="status-color" v-show="it.orderType !== 'history_not_repaired'">{{it.followup}}</view>
				</view>
				<view class="top-content">
					<view class="bottem-ev">{{`${it.diseaseStatus || ''}`}}</view>
				</view>
			</view>
			<view v-if="dataList.length === 0">
				<u-empty mode="data" text="数据为空" icon="http://cdn.uviewui.com/uview/empty/data.png"></u-empty>
			</view>
		</scroll-view>
	</view>
	</view>
</template>

<script>
	import mixins from '@/utils/mixins.js'
	export default {
		name: 'notRepaired',
		mixins: [mixins],
		props: {
			dataList: {
				type: Array,
				default: () => {
					return []
				}
			},
			tabType: {
				type:String,
				default: ''
			}
		},
		data() {
			return {
				ownerCode:undefined
			}
		},
		mounted() {
			this.ownerCode = uni.getStorageSync('ownerCode')
			console.log(this.ownerCode, '业主 ');
		},
		methods: {
			jump(it) {
				if(it.orderType === "history_not_repaired"){
					uni.navigateTo({
						url: `/subpackage-enginner/pages/engineeringMaintenance/on_site_inspection/components/diseaseHistory?id=${it.id}&type=${it.mileage}`
					})
				}else if(it.orderType === "add") {
					uni.navigateTo({
						url: `/subpackage-enginner/pages/engineeringMaintenance/on_site_inspection/components/changeDisease?id=${it.id}&type=${it.mileage}`
					})
				}else {
					// &name=${this.titleName}
					uni.navigateTo({
						url: `/subpackage-enginner/pages/engineeringMaintenance/on_site_inspection/components/modifyDisease?id=${it.id}&type=${it.mileage}`
					})
				}
				
				
			},
			// setBgColor(str) {
			// 	const greenList = ['高转中', '高转低', '高转无', '中转低', '中转无', '低转无']
			// 	const orangeList = ['低转高', '低转中', '中转高']
			// 	if (str === '无') {
			// 		return 'grey'
			// 	} else if (str === '新增') {
			// 		return 'blue'
			// 	} else if (greenList.includes(str)) {
			// 		return 'green'
			// 	} else if (orangeList.includes(str)) {
			// 		return 'orange'
			// 	} else {
			// 		return ''
			// 	}
			// },
			/**
			 * 高中低无  红橙蓝蓝
			 * **/
			setLevelColor(str) {
				if(str === 'tall') {
					return 'red'
				}else if(str === 'central') {
					return 'orange'
				}else if(str === 'bottom' || str === 'nought') {
					return 'blue'
				}else {
					return ''
				}
			},
			getFlag(str1,str2) {
				// debugger
				return str1.trim()&&str2&&true
			}
		}
	}
</script>

<style lang="scss" scoped>
	.all-content {
		padding-right: 40rpx;
		margin-left: 30rpx;
		margin-top: 30rpx;
		.t-content {
			height: 121rpx;
			border-bottom: 1rpx dashed #E0E7F6;
			padding-top: 20rpx;
		}

		.top-content {
			display: flex;
			justify-content: flex-start;
			align-items: center;

			.top-ring {
				width: auto;
				height: 44rpx;
				font-size: 32rpx;
				font-family: PingFang SC-Bold, PingFang SC;
				font-weight: bold;
				color: #445469;
				line-height: 38rpx;
				margin-right: 20rpx;
				max-width: calc(100% - 110rpx);
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
				
			}

			.top-lv {
				width: auto;
				padding: 6rpx 20rpx;
				clip-path: polygon(15rpx 0, 100% 0, calc(100% - 15rpx) 52rpx, 0% 52rpx);
				height: 34rpx;
				font-size: 26rpx;
				font-family: PingFang SC-Bold, PingFang SC;
				font-weight: bold;
				color: #FFFFFF;
				line-height: 34rpx;
				background: linear-gradient(90deg, #5295FE 0%, #3FB8FF 100%);
				text-align: center;
				opacity: 1;
			}
			.top-lv.red {
				background: linear-gradient(90deg, #FF2B2B 0%, #FF603D 100%);
				
			}
			.top-lv.orange {
				background: linear-gradient(90deg, #FF882B 0%, #FF9F3D 100%);
			}
			.top-lv.blue {
				background: linear-gradient(90deg, #5295FE 0%, #3FB8FF 100%);
			}

			.status-color {
				min-width: max-content;
				padding: 6rpx 18rpx;
				margin-right: 20rpx;
				clip-path: polygon(15rpx 0, 100% 0, calc(100% - 15rpx) 52rpx, 0% 52rpx);
				height: 34rpx;
				font-size: 26rpx;
				font-family: PingFang SC-Bold, PingFang SC;
				font-weight: bold;
				color: #FFFFFF;
				line-height: 34rpx;
				// background: linear-gradient(90deg, #5295FE 0%, #3FB8FF 100%);
				background-color:  #C6CDD8;
				text-align: center;
			}

			.status-color.grey {
				background-color: #d7d7d7;
			}

			.status-color.blue {
				background-color: #0297d7;
				// background: linear-gradient(90deg, #0297d7 0%, #0297d7 100%);
			}

			.status-color.orange {
				background-color: #f59a23;
			}

			.status-color.green {
				background-color: #03b615;
			}
		}

		.bottem-ev {
			margin-top: 20rpx;
			height: 40rpx;
			font-size: 28rpx;
			font-family: PingFang SC-Medium, PingFang SC;
			font-weight: 500;
			color: #6A819E;
			line-height: 32rpx;
			max-width: 450rpx;
			text-overflow: ellipsis;
			overflow: hidden;
			white-space: nowrap;
		}
	}


</style>
